// 获取节点
var list_item = document.getElementsByClassName("list_item");
var del = document.getElementsByClassName("del");
console.log(list_item);//检测节点是否被获取
console.log(del);//检测节点是否被获取
var index = 0;//存放索引号
for(var i = 0;i < list_item.length; i++){
    //存放0-5的索引
    list_item[i].suoyin = i;
    // 鼠标按下的函数
    list_item[i].onmousedown = function(){
        // 获取当前的索引
        index = this.suoyin;
        // 初始化
        for(var j=0; j<del.length;j++){
            list_item[j].style.marginLeft = "0px";
            del[j].style.right ="-56.6px";
        }
        // 操作当前索引
        list_item[index].style.marginLeft = "-56.5px";
        list_item[index].style.transition = "all 0.8s";
        del[index].style.right ="0px";
        del[index].style.transition = "all 0.8s";
    }
    // 删除按钮的事件
    del[i].onclick = function(){
        list_item[index].style.display = "none";
    }
}



